/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package drinkcounter.web.servlet;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import drinkcounter.DrinkCounterService;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Burn alcohol of every participant in every party
 * @author Toni
 */
@Singleton
public class BurnAlcoholServlet extends HttpServlet{

    @Inject
    private DrinkCounterService drinkCounterService;

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        float hours = Float.parseFloat(req.getParameter("timePassed"));
        drinkCounterService.timePassed(hours);
        resp.getOutputStream().close();
    }

}
